#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "
USE edu_online_dwb;
DROP TABLE if exists edu_online_dwb.dwb_visit_consult_detail;
CREATE TABLE edu_online_dwb.dwb_visit_consult_detail
(
    id                           INT COMMENT '主键',
    day                          STRING COMMENT '天',
    month                        string comment '月',
    quarter                      STRING COMMENT '季度',
    year                         STRING COMMENT '年',
    session_id                   STRING  COMMENT '七陌sessionId',
    sid                          STRING  COMMENT '访客id',
    seo_source                   STRING COMMENT '搜索来源',
    ip                           STRING COMMENT 'IP地址',
    area                         STRING COMMENT '地域',
    country                      STRING COMMENT '所在国家',
    province                     STRING COMMENT '省',
    city                         STRING COMMENT '城市',
    origin_channel               STRING COMMENT '投放渠道',
    msg_count                    INT      COMMENT '客户发送消息数',
    from_url                     STRING COMMENT '会话来源页面'
)
COMMENT '访问查询宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress' = 'ZLIB');
"